Fix #12: Add gateway contract test suite across providers#17
Fix #12: Add gateway contract test suite across providers#17WarLikeLaux wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17 +/- ##
============================================
+ Coverage 73.74% 75.46% +1.72%
Complexity 573 573
============================================
Files 52 52
Lines 2030 2030
============================================
+ Hits 1497 1532 +35
+ Misses 533 498 -35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR introduces a reusable contract-testing framework for payment gateways. It adds an abstract base class that defines the contract tests themselves, plus concrete implementations for four gateways (PayPal, Robokassa, Stripe, YooKassa). Each gateway implementation provides fixtures that configure the gateway, queue HTTP responses, and define expected result shapes. ChangesGateway Contract Testing Framework
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.2.1)PHP Parse error: syntax error, unexpected token "->", expecting ";" in /vendor/php-standard-library/php-standard-library/packages/class/src/Psl/Class/has_constant.php on line 18 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Heads-up from writing the suite: intents are genuinely interchangeable (the |
What does this PR do?
Adds a shared gateway contract test suite that runs one set of assertions against every gateway through
PaymentGatewayInterface, proving a provider can be swapped without changing caller code.An abstract
GatewayContractTestCaseholds the assertions; the Stripe, PayPal, Robokassa and YooKassa subclasses supply only a gateway factory, canned HTTP responses and expected values. Existing per-provider tests stay - they cover request encoding, which the contract suite does not.Changelog not required, because no source files changed.
Summary by CodeRabbit
Tests